<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            box-sizing: border-box;
        }

        .warp {
            position: relative;
            width: 400px;
            height: 400px;
            overflow: hidden;
            background-image: linear-gradient(0deg, #33333300, #333, #33333300);
            background-clip: text;
        }


        .content {
            position: absolute;
            inset: 0;
            border-radius: 50%;
            border: 2px solid #ccc;


        }

        .content .text {
            /* position: absolute; */
            margin: 20px;
            /* color: transparent; */
            /* background-image: linear-gradient(0deg, #33333300, #333, #33333300);
            background-clip: text; */
        }
    </style>
</head>

<body>
    <div class="warp">
        <div class="content">
            <div class="text" style="--i: 1"> NihaoA</div>
            <div class="text" style="--i: 2"> NihaoA</div>
            <div class="text" style="--i: 3"> NihaoA</div>
            <div class="text" style="--i: 4"> NihaoA</div>
            <div class="text" style="--i: 5"> NihaoA</div>
            <div class="text" style="--i: 6"> NihaoA</div>
        </div>
    </div>
    <script>
        let textsNode = document.querySelectorAll('.text');
        let contentNode = document.querySelector('.content');
        // 获取contentNode的高度
        let contentNodetRect = contentNode.getClientRects()[0];
        let contentHeight = contentNodetRect.height;
        for (let i = 0; i < textsNode.length; i++) {
            // 获取文字的宽度
            let textNodeRt = textsNode[i].getClientRects()[0];
            // textsNode[i].style.top = `${i * (contentHeight / textsNode.length)}px`;
            // textsNode[i].style.right = `-${i * textNodeRt.width}px`
        }

    </script>
</body>

</html>